home *** CD-ROM | disk | FTP | other *** search
- /*
- Restore CIA Timer
- Thomas Radtke 20.03.95
- Report bugs/other types of E-Clocks for implementing to
- thradtke@nereid.rz.uni-osnabrueck.de
- E-Mail Address valid at least until Oct, 95
- */
-
- #include <intuition/intuitionbase.h>
- #include <resources/battclock.h>
-
- struct timerequest tr;
- struct Library *BattClockBase;
-
- main()
- {
- ULONG secs;
-
- if (!(BattClockBase=(struct Library *)OpenResource(BATTCLOCKNAME))) exit(1);
- OpenDevice(TIMERNAME,UNIT_MICROHZ,(struct IORequest *)&tr,0);
- secs=(ULONG)ReadBattClock();
- tr.tr_node.io_Command=TR_SETSYSTIME;
- tr.tr_time.tv_secs=secs;
- tr.tr_time.tv_micro=0;
- DoIO((struct IORequest *)&tr);
- CloseDevice((struct IORequest *)&tr);
- exit(0);
- }
-